// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import axios from 'axios'
import API from './utils/APIUtils'
import fetch from './utils/fetch'

import "../src/assets/css/free.css"
import "../src/assets/css/animate.min.css"

import '../src/assets/css/iconfont.css'


import $ from 'jquery'
import 'bootstrap3/dist/css/bootstrap.min.css'
import 'bootstrap3/dist/js/bootstrap.min'

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import 'element-ui/lib/theme-chalk/display.css';
Vue.use(ElementUI);

import './utils/filters'
import uploader from 'vue-simple-uploader'

Vue.use(uploader)

Vue.prototype.API = API;
Vue.config.productionTip = false
Vue.prototype.$axios = axios;


const extend = Vue.prototype
extend.$post = fetch.post
extend.$get = fetch.get
extend.$put = fetch.put
extend.$form = fetch.form

import VueClipboard from 'vue-clipboard2'
Vue.use(VueClipboard)





//防止手动修改localstorage
window.addEventListener('storage', (e) => {
  sessionStorage.setItem(e.key, e.oldValue) //重新赋值修改前的值
})


//配置请求
// axios.interceptors.request.use(config=>{
//   config.headers.Authorization=sessionStorage.getItem('token')
//   return config
// })

Vue.prototype.$EventBus = new Vue(); //全局的事件总线


/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: {
    App
  },
  template: '<App/>'
})
